Open
Conversation
p-senichenkov
suggested changes
Dec 4, 2025
p-senichenkov
left a comment
There was a problem hiding this comment.
Палиндром -- 7/10 (но ставить эту оценку некуда)
Максимальная сумма -- 5/10
Обезьяньей сортировки здесь нет
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Вы не добавили решение этой задачи на HWProj, так что поставить оценку не получится
|
|
||
| int systemChangerTo2(int n) { | ||
| int binaryNum[1000]; //Массив для числа во вторичной | ||
| char charBinaryNum[1000]; // Массив для числа во вторичной, но в виде строки |
There was a problem hiding this comment.
Зачем нужно два представления? Вполне хватит какого-то одного.
| } else { | ||
| return 0; | ||
| } | ||
| if (left > right) { |
There was a problem hiding this comment.
Это условие уже проверяется в заголовке цикла. Второй раз его проверять не нужно.
Comment on lines
+15
to
+22
| while (temp / 10 != 0) { // "Резатель числа", режем - пока оно не станет нулевым, прибавляем хвостик к сумме | ||
| tempSum += (temp % 10); | ||
| temp = temp/10; | ||
| printf("Sum %d\n", tempSum); | ||
| printf("%d \n", temp); | ||
| } | ||
| tempSum = temp + tempSum; | ||
| printf("Sum %d\n", tempSum); |
There was a problem hiding this comment.
- Ваша программа выводит ответ в
stdin, так что отладочный вывод лучше убрать. - Этот код можно упростить, если использовать более естественное условие в цикле.
| int maxSum = finder(arr, size); | ||
|
|
||
| printf("\n"); | ||
| printf("Max sum of numbers %d", maxSum); |
There was a problem hiding this comment.
Выводится вообще не то, что нужно по условию.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Добавлено два файла для контрольной - max.c и diffPalindrome.c
В первом поиск суммы максимального числа, во втором палиндром в двоичной системе
Долженко Александра